package cn.mandy.sysadmin.service;

import cn.mandy.sysadmin.dto.MandyRegister;
import cn.mandy.sysadmin.model.MandyUser;
import org.springframework.security.core.Authentication;

import javax.servlet.http.HttpServletRequest;

public interface MandyRbacService {
    boolean hasPermission(HttpServletRequest request, Authentication authentication);

    /**
     * 登录功能
     * @param username 用户名
     * @param password 密码
     * @return 生成的JWT的token
     */
    String login(String username, String password);

    String refreshToken(String oldToken);

    int register(MandyRegister registerData);

    int passwordUpdate(MandyUser mandyUser);

    String getAvatar(Long blobDataId);

    int changeCurrentRoleId(Long newRoleId);
}
